#include <avr/io.h>

uint16_t pressureChamberTemperature = 600;
uint16_t vacuumChamberTemperature = 0;
uint16_t pressureChamberPressure = 0;
uint16_t vacuumChamberPressure = 0;
uint16_t resistanceWireVoltagePressureChamber = 0;
uint16_t resistanceWireVoltageVacuumChamber = 0;
uint16_t battery1Voltage = 0;
uint16_t battery2Voltage = 0;

void initADC()
{
		DDRD	|= 1 << PIND0;		
		ADCSRA	|= 1 << ADPS2;
		ADMUX	|= 1 << ADLAR;
		ADMUX	|= 1 << REFS0;
		ADCSRA	|= 1 << ADIE;
		ADCSRA	|= 1 << ADEN;
		ADCSRA	|= 1 << ADSC;
}

uint16_t getPressureChamberTeperature()
{
	return pressureChamberTemperature;
}

uint16_t getVacuumChamberTemperature()
{
	return vacuumChamberTemperature;
}

uint16_t getPressureChamberPressure()
{
	return pressureChamberPressure;
}

uint16_t getVacuumChamberPressure()
{
	return vacuumChamberPressure;
}

uint16_t getResistanceWireVoltagePressureChamber()
{
	return resistanceWireVoltagePressureChamber;
}

uint16_t getResistanceWireVoltageVacuumChamber()
{
	return resistanceWireVoltageVacuumChamber;
}

uint16_t getBattery1Voltage()
{
	return battery1Voltage;
}

uint16_t getBattery2Voltage()
{
	return battery2Voltage;
}

ISR(ADC_vect)
{
	//TODOO
	uint8_t theLow = ADCL;
	uint16_t tenBitValue = ADCH << 2 | theLow >> 6;
}